<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>错误页面</title>
    <style>
        body {
            font-family: 'Microsoft YaHei', Arial, sans-serif;
            background-color: #f0f4f8;
            margin: 0;
            padding: 0;
            text-align: center;
            color: #333;
        }
        .container {
            width: 95%;
            max-width: 1400px;
            margin: 20px auto;
            background-color: #ffffff;
            padding: 40px;
            border-radius: 15px;
            box-shadow: 0 6px 30px rgba(0, 0, 0, 0.15);
        }
        .error-icon {
            font-size: 80px;
            color: #dc3545;
            margin-bottom: 20px;
        }
        .error-title {
            font-size: 32px;
            font-weight: bold;
            margin-bottom: 20px;
            color: #dc3545;
        }
        .error-message {
            font-size: 24px;
            margin-bottom: 30px;
        }
        .error-details {
            font-size: 18px;
            color: #6c757d;
            margin-bottom: 30px;
            text-align: left;
            padding: 20px;
            background-color: #f8f9fa;
            border-radius: 10px;
            max-width: 800px;
            margin-left: auto;
            margin-right: auto;
        }
        .back-button {
            padding: 15px 30px;
            font-size: 20px;
            border: none;
            border-radius: 10px;
            background-color: #007BFF;
            color: white;
            cursor: pointer;
            transition: background-color 0.3s ease;
            margin-right: 10px;
        }
        .back-button:hover {
            background-color: #0056b3;
        }
        .home-button {
            padding: 15px 30px;
            font-size: 20px;
            border: none;
            border-radius: 10px;
            background-color: #6c757d;
            color: white;
            cursor: pointer;
            transition: background-color 0.3s ease;
        }
        .home-button:hover {
            background-color: #5a6268;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="error-icon">⚠️</div>
    <div class="error-title" th:text="${statusCode != null ? '错误 ' + statusCode : '发生错误'}">错误</div>
    <div class="error-message" th:text="${errorMessage ?: '发生未知错误'}">发生未知错误</div>
    
    <div class="error-details" th:if="${errorDetails != null}">
        <p th:text="${errorDetails}"></p>
    </div>
    
    <div>
        <button class="back-button" onclick="window.history.back()">返回上一页</button>
        <button class="home-button" onclick="window.location.href='/dashboard'">返回首页</button>
    </div>
</div>
</body>
</html>